package com.factory.ssm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.factory.ssm.beans.Factory;
import com.factory.ssm.beans.Pharmaceutical;
import com.factory.ssm.mapper.PharmaceuticalMapper;


@Service
public class PharmaceuticalServiceImpl implements PharmaceuticalService {
	
	@Autowired
	PharmaceuticalMapper pharmaceuticalMapper;

	@Override
	public List<Pharmaceutical> getpharmaceuticalByFactoryId(String factoryId) {
		// TODO Auto-generated method stub
		return pharmaceuticalMapper.getpharmaceuticalByFactoryId(factoryId);
	}

	@Override
	public void insert(Pharmaceutical pharmaceutical) {
		// TODO Auto-generated method stub
		pharmaceuticalMapper.insert(pharmaceutical);
	}

	@Override
	public void deletePharmaceuticalById(Integer id) {
		// TODO Auto-generated method stub
		pharmaceuticalMapper.deleteById(id);
	}

	@Override
	public Pharmaceutical getPharmaceuticalById(Integer id) {
		// TODO Auto-generated method stub
		return pharmaceuticalMapper.getPharmaceuticalById(id);
	}

	@Override
	public void updatePharmaceuticalById(Pharmaceutical pharmaceutical) {
		// TODO Auto-generated method stub
		pharmaceuticalMapper.updatePharmaceuticalById(pharmaceutical);
	}

	@Override
	public void deleteByFactoryId(String id) {
		// TODO Auto-generated method stub
		pharmaceuticalMapper.deleteByFactoryId(id);
	}

	@Override
	public void updatePharmaceuticalByFactoryId(Factory factory) {
		// TODO Auto-generated method stub
		System.out.println("zhixingle");
		pharmaceuticalMapper.updatePharmaceuticalByFactoryId(factory);
	}

}
